﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
using Estimate.Common.Estimate;
using Estimate.Common.Entity;
using Estimate.Common.DBFieldTypes;
using Estimate.Common.Repository;
using Estimate.Common;
using Estimate.Reports;

namespace ExportData
{
    class Program
    {
        static void Main(string[] args)
        {
            string ConnectionString=ConfigurationManager.AppSettings["ConnectionString"];
            string beginDate = ConfigurationManager.AppSettings["BegineDate"];
            string endDate = ConfigurationManager.AppSettings["EndDate"];
            DateTime BeginDate = DateTime.Parse(beginDate);
            DateTime EndDate = DateTime.Parse(endDate);
            string dir = ConfigurationManager.AppSettings["Dir"];
            string semiType = ConfigurationManager.AppSettings["SemiType"];
            string rankType = ConfigurationManager.AppSettings["CollectionRankType"];
            ForeSemiType foreSemiType = (ForeSemiType)Enum.Parse(typeof(ForeSemiType), semiType);
            CollectionRankType collectionRankType = (CollectionRankType)Enum.Parse(typeof(CollectionRankType), rankType);

            ExportForeAndRealData exportData = new ExportForeAndRealData(ConnectionString, collectionRankType);
            exportData.ExportData(BeginDate, EndDate, foreSemiType, dir);
        }
    }
}
